import React, { FC } from "react";

interface HelloProps {
  name: string;
  age: number;
  sex?: string;
}

class Hello extends React.Component<HelloProps> {
  render() {
    const { name, age, sex } = this.props;
    return <p>Hello, {this.props.name}</p>;
  }
}

const World: FC<HelloProps> = ({ name, age, sex }) => {
  return <p>World</p>;
};

class App extends React.Component {
  render() {
    return (
      <div>
        <h1>App</h1>

        <Hello name="张三" age={100} />

        <World name="里斯" age={200} />
      </div>
    );
  }
}

export default App;
